package com.sq.partner.manager.service;

import java.io.InputStream;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.sq.partner.manager.common.Result;
import com.sq.partner.manager.mybatis.model.ActirationCardActivated;
import com.sq.partner.manager.mybatis.model.ActirationCardBatchInsuredDto;
import com.sq.partner.manager.mybatis.model.CardInfo;
import com.sq.partner.manager.mybatis.model.DictOccupDto;
import com.sq.partner.manager.mybatis.model.FacadeAppApplicant;
import com.sq.partner.manager.mybatis.model.FacadeAppForm;
import com.sq.partner.manager.mybatis.model.FacadeAppFormExtend;
import com.sq.partner.manager.mybatis.model.FacadeAppInsured;
import com.sq.partner.manager.mybatis.model.FacadeTempPolicy;
import com.sq.partner.manager.mybatis.model.GatewayUser;

/**
 * 激活卡激活Service
 * 
 * @author zhouxiuxiu
 *
 */
public interface ActirationCardActivatedService {

    /**
     * 校验卡号密码是否正确
     * 
     * @param cardNo
     * @param password
     * @return
     * @throws Exception
     */
    public Result checkCard(String cardNo, String password) throws Exception;

    /**
     * 取得方案和产品信息
     * 
     * @param planNo
     * @return
     * @throws Exception
     */
    public ActirationCardActivated getProdInfoByPlanNo(String planNo)
            throws Exception;

    /**
     * 保存投保信息
     * 
     * @param facadeAppForm
     * @param extend
     * @param facadeAppApplicant
     * @param facadeAppInsured
     * @param gatewayuser
     * @param cardNo
     * @return
     * @throws Exception
     */
    public Result saveOrUpdateSingleTemporary(FacadeAppForm facadeAppForm,
            FacadeAppFormExtend extend, FacadeAppApplicant facadeAppApplicant,
            List<FacadeAppInsured> facadeAppInsureds, GatewayUser gatewayuser,
            String cardNo, String isSeeMoney) throws Exception;

    /**
     * 根据暂存单查询保单表,投保信息表,被表信息表
     * 
     * @param stagNo
     * @return
     * @throws Exception
     */
    public Map<String, Object> queryAllObjectMessage(String stagNo)
            throws Exception;

    /**
     * 处理状态为01,11,13 暂存单 根据暂存单状态判断保单是否投保成功 报文返回错误信息errInfo,resultCode;
     * 
     * @param facadeTempPolicy
     * @return
     * @throws Exception
     */
    public FacadeTempPolicy sendNlife(CardInfo cardInfo,
            FacadeTempPolicy facadeTempPolicy) throws Exception;

    /**
     * 更新卡单表的暂存单号
     * 
     * @param cardNo
     * @param stagNo
     * @throws Exception
     */
    public Result updateStagNoByCardNo(Map<String, String> param)
            throws Exception;
    
    public Map<String, Object> queryAllObjectInfo(String appNo)
            throws Exception;
    
    /**
     * 有价激活卡缴费确认
     * @param cardNo
     * @throws Exception
     */
    public Result updatePayCostCallBack(String cardNo,String commamtIdString,
            String stagNo,BigDecimal singlePremamt) throws Exception;
    
    /**
     * 查询职业树结构
     * @param id
     * @return
     * @throws Exception
     */
    public List<DictOccupDto> queryWorkTree(String id) throws Exception;
    
    /**
     * 批量投保保存
     * @param facadeAppForm
     * @param extend
     * @param facadeAppApplicant
     * @param facadeAppInsured
     * @param gatewayuser
     * @param cardNo
     * @param isSeeMoney
     * @param stagNo
     * @return
     * @throws Exception
     */
    public Result saveBatchTemporary(FacadeAppForm facadeAppForm,
            FacadeAppFormExtend extend, FacadeAppApplicant facadeAppApplicant,
            FacadeAppInsured facadeAppInsureds, GatewayUser gatewayuser,
            String cardNo, String isSeeMoney, String stagNo, int i) throws Exception;
    
    /**
     * 查询暂存单下的投保单数
     * @param stagNo
     * @return
     * @throws Exception
     */
    public int queryAppCountByStagNo(String stagNo) throws Exception;
    
    /**
     * 查询暂存单下的卡总张数
     * @param stagNo
     * @return
     * @throws Exception
     */
    public int queryCardCountByStagNo(String stagNo) throws Exception;
    
    public FacadeAppForm sendNlife1(FacadeAppForm form) throws Exception;
    
    /**
     * 批量投保页面删除投保信息
     * @param cardNo
     * @param stagNo
     * @return
     * @throws Exception
     */
    public Result deleteAppInfo(String cardNo, String stagNo) throws Exception;
    
    /**
     * 批量投保信息取得
     * @param stagNo
     * @return
     * @throws exception
     */
    public List<ActirationCardBatchInsuredDto> getBatchInsuredList(String stagNo) throws Exception;
    
    /**
     * 删除批量投保信息
     * @param stagNo
     * @return
     * @throws Exception
     */
    public Result deleteBatchByStagNo(String stagNo) throws Exception;
    
    /**
	 * 更新暂存单表和投保单表状态（12：已支付） 20190425 helina
	 * @param stagNo
	 * @return
	 * @throws Exception
	 */
	public boolean afterPayUpdateStatus(String stagNo) throws Exception;

	public List<InputStream> getFileInputStream(MultipartFile[] myfiles) throws Exception;

	public Map<String, Object> insertDataToPage(InputStream inputStream, String riskMainType, String cardDefineId) throws Exception;

	boolean countCheck(FacadeAppForm facadeAppForm, FacadeAppInsured facadeAppInsured) throws Exception;

    boolean countCheckBatch(FacadeAppForm facadeAppForm, FacadeAppInsured facadeAppInsured, String stagNo) throws Exception;
}
